

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Edit Event</title>
        <resource:dateChooser />
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><g:link class="create" action="create">New Event</g:link></span>
        </div>
        <div class="body">
            <h1>Edit Event</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${eventInstance}">
            <div class="errors">
                <g:renderErrors bean="${eventInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <input type="hidden" id="user.id" name="user.id" value="${eventInstance?.user?.id}"/>
                <input type="hidden" name="id" value="${eventInstance?.id}" />
                <input type="hidden" name="version" value="${eventInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="name">Name:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:eventInstance,field:'name','errors')}">
                                    <input type="text" id="name" name="name" value="${fieldValue(bean:eventInstance,field:'name')}"/>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="eventDate">Event Date:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:eventInstance,field:'eventDate','errors')}">
                                    <richui:dateChooser name="eventDate" format="dd.MM.yyyy" />
                                    <!-- <g:datePicker name="eventDate" value="${eventInstance?.eventDate}" ></g:datePicker>-->
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="alertDaysBefore">Alert Days Before:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:eventInstance,field:'alertDaysBefore','errors')}">
                                  <g:select name="alertDaysBefore" from="${1..14}" value="${eventInstance.alertDaysBefore}"/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="blogAlert">Blog Alert:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:eventInstance,field:'blogAlert','errors')}">
                                    <g:checkBox name="blogAlert" value="${eventInstance?.blogAlert}" ></g:checkBox>
                                </td>
                            </tr>
                    
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="mailAlert">Mail Alert:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:eventInstance,field:'mailAlert','errors')}">
                                    <g:checkBox name="mailAlert" value="${eventInstance?.mailAlert}" ></g:checkBox>
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
